<template>
	<view>
		<view class="liebiao">
			<view class="shang" v-for="item in shangpinlist" :key="item.id" @click=details(item.id)>
				<view class=" ddd">
					<image src="../../static/88.jpg" mode="" class="img1"></image>
					<view class="">
						<text class="jia">￥{{item.sell_price}}</text>
						<text class="ge">{{item.market_price}}</text>
					</view>
					<view class=""><text class="text1">{{item.title}}</text></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		created() {
			this.shang()
		},
		data() {
			return {
				shangpinlist: [],
				pageindex: 1
			}
		},
		methods: {
			async shang() {
				const {
					status,
					message
				} = await uni.$Http.get(`getgoods?${this.pageindex}`)
				this.shangpinlist = message
			},
			async details(id) {
				uni.navigateTo({
					url: "../xiangqing/xiangqing?id=" + id
				})
			}
		}
	}
</script>

<style scoped>
	page {
		height: 101vh;
	}

	.shang {
		background-color: #FFFFFF;
	}

	.liebiao {
		display: flex;
		justify-content: space-around;
		flex-wrap: wrap;
		background-color: #D7CBBF;
	}

	.ddd {
		width: 150px;
	}

	.img1 {
		width: 100%;
	}

	.text1 {
		font-size: 13px;
	}

	.jia {
		font-size: 20px;
		color: #E43C2F;
	}

	.ge {
		text-decoration: line-through;
	}
</style>
